<template>
  <div class="cart">
    <nav-bar class="nar-bar">
      <div slot="center">购物车({{cartListLength}})</div>
    </nav-bar>
    <scroll class="content" ref="scroll">
      <cart-list />
    </scroll>
    <cart-bottom-bar/>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import Scroll from 'components/common/scroll/Scroll'
import NavBar from 'components/common/navbar/NavBar'
import CartList from './childCpns/CartList'
import CartBottomBar from './childCpns/CartBottomBar'
export default {
  name: 'Cart',
  props: {
    msg: String
  },
  components: {
    NavBar,
    CartList,
    Scroll,
    CartBottomBar
  },
  computed: {
    ...mapGetters(['cartList','cartListLength'])
  },
  activated() {
    this.$refs.scroll.refresh()
  }
}
</script>


<style scoped>
.cart{
  height: 100vh;
}
.nav-bar{
  background-color: var(--color-tint);
  font-weight: 700;
  color: #fff;
}
.content{
  height: calc(100vh - 44px - 49px);
  overflow: hidden;
}
</style>
